package com.common.app.widget.mybanner;

import android.text.TextUtils;
import java.io.Serializable;

/**
 * Created by sosou on 2017/11/1.
 */
public class BannerBean implements Serializable {

    /**
     * id
     */
    private String id;

    /**
     * 标题
     */
    private String title;

    /**
     * 图片地址
     */
    private String image;

    /**
     * 深链
     */
    private String scheme;

    /**
     * 拓展数据
     */
    private String exData;

    /**
     * 网页地址
     */
    private String link;

    /**
     * 跳转类型
     */
    private int linkType;

    /**
     * 名字
     */
    private String name;

    /**
     * 图片地址
     */
    private String spareImage;

    /**
     * 活动id
     */
    private String activityId;

    /**
     * 商品id
     */
    private String productId;

    /**
     * 商品描述
     */
    private String introduction;

    /**
     * 原价
     */
    private String price;

    /**
     * 现价
     */
    private String activityPrice;

    /**
     * url
     */
    private String productLogo;


    /**
     * 10=门店 20=分类 30=商品
     */
    private int objectType;

    /**
     * 是否需要登录
     */
    private boolean shouldLogin;

    @Override
    public String toString() {
        return "BannerBean{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", image='" + image + '\'' +
                ", scheme='" + scheme + '\'' +
                ", link='" + link + '\'' +
                ", linkType=" + linkType +
                ", name='" + name + '\'' +
                ", spareImage='" + spareImage + '\'' +
                ", activityId='" + activityId + '\'' +
                ", productId='" + productId + '\'' +
                ", introduction='" + introduction + '\'' +
                ", price='" + price + '\'' +
                ", activityPrice='" + activityPrice + '\'' +
                ", productLogo='" + productLogo + '\'' +
                ", objectType=" + objectType +
                '}';
    }

    public BannerBean(String id, String title, String image, String link, int linkType, String name, String spareImage) {
        this.id = id;
        this.title = title;
        this.image = image;
        this.link = link;
        this.linkType = linkType;
        this.name = name;
        this.spareImage = spareImage;
    }

    public BannerBean(String id, int objectType, String title, String image, String scheme, String link, int linkType, String name, String spareImage) {
        this.id = id;
        this.objectType = objectType;
        this.title = title;
        this.image = image;
        this.scheme = scheme;
        this.link = link;
        this.linkType = linkType;
        this.name = name;
        this.spareImage = spareImage;
    }


    public BannerBean(String id, int objectType, String title, String image, String scheme, String link, int linkType, String name, String spareImage, String exData,boolean shouldLogin) {
        this.id = id;
        this.objectType = objectType;
        this.title = title;
        this.image = image;
        this.scheme = scheme;
        this.link = link;
        this.linkType = linkType;
        this.name = name;
        this.spareImage = spareImage;
        this.exData = exData;
        this.shouldLogin = shouldLogin;
    }

    public BannerBean(String activityId, String productId, String introduction, String price, String activityPrice, String productLogo) {
        this.activityId = activityId;
        this.productId = productId;
        this.introduction = introduction;
        this.price = price;
        this.activityPrice = activityPrice;
        this.image = productLogo;
        this.title = "";
    }


    public BannerBean(String id, int objectType, String title, String image, String link, int linkType, String name, String spareImage) {
        this.id = id;
        this.objectType = objectType;
        this.title = title;
        this.image = image;
        this.link = link;
        this.linkType = linkType;
        this.name = name;
        this.spareImage = spareImage;
    }

    public String getScheme() {
        return scheme;
    }

    public int getObjectType() {
        return objectType;
    }

    public String getActivityId() {
        return activityId;
    }

    public String getProductId() {
        return productId;
    }

    public String getIntroduction() {
        return introduction;
    }

    public String getPrice() {
        return price;
    }

    public String getActivityPrice() {
        return activityPrice;
    }

    public String getProductLogo() {
        return productLogo;
    }

    public String getImage() {
        return image;
    }

    public String getSpareImage() {
        return spareImage;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setImgUrl(String imgUrl) {
        this.image = imgUrl;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public void setLinkType(int linkType) {
        this.linkType = linkType;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {

        return id;
    }

    public String getTitle() {
        return title;
    }

    public String getImgUrl() {
        return TextUtils.isEmpty(image) ? spareImage : image;
    }

    public String getLink() {
        return link;
    }

    public String getExData() {
        return exData;
    }

    public int getLinkType() {
        return linkType;
    }

    public String getName() {
        return name;
    }

    public boolean isShouldLogin() {
        return shouldLogin;
    }
}
